<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="layui-v2.5.7/layui/css/layui.css">
    <link rel="stylesheet" href="./css/guanli.css">
    <script src="dataJs/data.js"></script>
    <script src="layui-v2.5.7/layui/layui.js"></script>
    <script src="jquery/jquery 1.11.0/jquery-1.11.0.js"></script>
    <script src="./js/guanli.js"></script>
    <script src="./template-web.js"></script>
</head>
<body>
    <div class="layui-container container">
        <span>
            <span>用户管理</span> /
            <span> 后台用户</span>
        </span>
        <div class="contentCute">
            <input type="text" id="search" name="search" class="layui-input inputStyle" placeholder="请输入你的名称">
            <button class="layui-btn btnClass" onclick="doSearch()">
                <i class="layui-icon layui-icon-search" style="font-size: 16px; color: white;"></i>
            </button>
        </div>
        <div class="contentCute" id="Btns">
            <button type="button" class="layui-btn btnCommon" onclick="doAdd()">新增</button>
            <button type="button" class="layui-btn btnCommon layui-btn-danger" onclick="doDelAll()">删除全部</button>
        </div>
        <div class="contentCute">
            <table class="layui-table">
                <colgroup>
                    <col width="150">
                    <col width="200">
                    <col>
                </colgroup>
                <thead>
                    <tr>
                        <th>用户ID</th>
                        <th>用户名</th>
                        <th>密码</th>
                        <th>手机号</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody id="tb">
                    
                </tbody>
            </table>
        </div>

    </div>
    <script type="text/html" id="demo">
        {{each users value index}}
        <tr>
            <td>{{ value.id }}</td>
            <td>{{ value.username }}</td>
            <td>{{ value.password }}</td>
            <td>{{ value.phone }}</td>
            <td>
                <input type="button" value="修改" class="layui-btn layui-btn-normal" onclick="doChange(this)">
                <input type="button" value="删除" class="layui-btn layui-btn-danger layui-btn-normal" onclick="doDel(this)">
            </td>
        </tr>
        {{/each}}
    </script>
</body>

<div id="msg" style="display: none;">
    <form id="formXiugai" class="layui-form" action="#">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline ">
                <input id="username" type="text" name="username" required lay-verify="usernameLogin"
                    placeholder="请输入用户名" autocomplete="off" class="layui-input inputs" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline inputLength">
                <input id="password" type="text" name="password" required lay-verify="passwordLogin"
                    placeholder="请输入密码" autocomplete="off" class="layui-input inputs">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-inline">
                <input id='phone' type="text" name="phoneNum" required lay-verify="phone" placeholder="请输入手机号"
                    autocomplete="off" class="layui-input inputs">
            </div>
        </div>
    </form>
</div>
<script>
    layui.use('layer', function () {
        var layer = layui.layer;
    });
</script>

</html>